package com.vpen.netty.demo.web.bean;

import demo.HashedWheelTimerDemo;
import io.netty.util.HashedWheelTimer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.TimeUnit;

/**
 * 描述
 *
 * @author 韦鹏
 * @date 2022/11/13 13:30
 */
@Configuration
public class Beans {


    @Bean("orderTimer")
    public HashedWheelTimer hashedWheelTimer() {
        // 时间论片间隔100ms,包含1024个论片(buket)
        return new HashedWheelTimer( 100, TimeUnit.MILLISECONDS, 1024);
    }


}
